import util from '../libs/util';

export function login(username,password) {
    const data = {
        username,
        password
    };
    return util.ajax({
        url: '/login',
        method: 'post',
        data
    });
}

export function logout() {
    return util.ajax({
        url: '/logout',
        method: 'post'
    });
}

export function getInfo() {
    return util.ajax({
        url: '/user/info',
        method: 'get'
    });
}